<!--
  描述：保修内容配置详情页
  @author tanghongjun
  @since 2020-06-09 11:07:32
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增或编辑分类</title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-elem-quote layui-text">
        <zmn th:text="${(warrantyContent.warrantyContentId > 0) ? '修改保修内容' : '新增保修内容'}"></zmn>
    </blockquote>

    <div class="layui-card">
        <form method="post" action="" class="layui-form" lay-filter="zmn-form">

            <input type="hidden" name="warrantyContentId" th:value="${warrantyContent.warrantyContentId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-form-item" th:if="${warrantyContent.warrantyContentId > 0}">
                <label class="layui-form-label">ID：</label>
                <div class="layui-input-block">
                    <div class="layui-form-mid">
                        <span th:text="${warrantyContent.warrantyContentId}">ID</span>
                        <span th:text="${warrantyContent.status == 2 ? '启用' : '禁用'}">status</span>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">保修内容：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" name="content" th:value="${warrantyContent.content}"
                               placeholder="最大30字，保修内容不能输入英文的“;”"
                               lay-verify="required" autocomplete="off" class="layui-input" maxlength="30"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">所属分类：</label>
                <div class="layui-input-inline">
                    <select name="servCategId" id="servCategId" lay-filter="servCategId" lay-verify="required"
                            th:value="${warrantyContent.servCategId}">
                        <option value="">请选择</option>
                        <zmn th:each="categ:${servCategories}">
                            <option th:value="${categ.categId}" th:selected="${categ.categId == warrantyContent.servCategId}"
                                    th:text="${categ.name}">
                                分类名称
                            </option>
                        </zmn>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="categOneId" id="categOneId" lay-filter="categOneId" lay-verify="required"
                            th:value="${warrantyContent.categOneId}">
                        <option value="">请选择</option>
                        <zmn th:each="basecateg:${baseCategories}">
                            <option th:value="${basecateg.key}" th:selected="${basecateg.key == warrantyContent.categOneId}"
                                    th:text="${basecateg.value}">产品以及分类
                            </option>
                        </zmn>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">业务类型：</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="bizType" value="1" title="C-保外业务"
                           th:checked="${warrantyContent.bizType != null && warrantyContent.bizType.indexOf('1') != -1}">
                    <input type="checkbox" name="bizType" value="2" title="F-保内业务"
                           th:checked="${warrantyContent.bizType != null && warrantyContent.bizType.indexOf('2') != -1}">
                    <input type="checkbox" name="bizType" value="3" title="B-工程业务"
                           th:checked="${warrantyContent.bizType != null && warrantyContent.bizType.indexOf('3') != -1}">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">排序：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" >
                        <input type="number" name="sort" th:value="${warrantyContent.sort}" placeholder="可输入1-100000的正整数"
                               lay-verify="required" autocomplete="off" class="layui-input" maxlength="6"/>
                    </div>
                </div>
            </div>

            <zmn th:if="${warrantyContent.warrantyContentId > 0}">
                <div class="layui-card-header"><b>其他信息</b></div>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">修改人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${warrantyContent.updater} + '&nbsp;/&nbsp;' + ${#dates.format(warrantyContent.updateTime, 'yyyy-MM-dd HH:mm:ss')}">
                            修改人/时间
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${warrantyContent.creater} + '&nbsp;/&nbsp;' + ${#dates.format(warrantyContent.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                            创建人/时间
                        </div>
                    </div>
                </div>
            </zmn>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">保存</button>
                        <!--                               <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit"  th:if="${#authPermit.checkPermit('/warranty/content/addEdit.action')}">保存</button>-->

                        <button class="layui-btn layui-btn-primary" id="cancleBtn" onclick="zmnLayUtil.closeThisTabs()">
                            取消
                        </button>
                    </div>
                </div>
            </div>

        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        warrantyContent: [[${warrantyContent}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        plat_warranty_content_detail: "warranty/content/zmn.plat.warrantycontent.edit",
    }).use(['index', 'plat_warranty_content_detail']);

</script>
</body>
</html>